package cn.chint.mapper;

import cn.chint.model.SysUser;
import cn.chint.model.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper1 {
    @Insert("insert into test_user(name,age) values(#{name},#{age})")
    void addUser(@Param("name") String name, @Param("age") int age);

    @Select("select * from  test_user where name=#{name}")
    List<User> selectUser(@Param("name") String name);

    @Select("select * from  test_user where id=#{id}")
    User selectUser_by_id(@Param("id") Long id);

    @Update("update  test_user set age=#{age} where id=#{id}")
    int updateUser_by_id(@Param("id") Long id,@Param("age") int age);

    @Delete("delete from  test_user where id=#{id}")
    int deleteUser_by_id(@Param("id") Long id);

    @Select("select * from  t_sys_user where username=#{username} and password=#{password}")
    SysUser selectSysUser(@Param("username") String username, @Param("password") String password);

}
